<template>
  <div>
    <van-nav-bar
      fixed
      :title="
        currentComment.reply_count
          ? currentComment.reply_count + '条回复'
          : '暂无回复'
      "
    >
      <van-icon slot="left" name="cross" @click="$emit('click-close')" />
    </van-nav-bar>

    <div class="content">
      <comment-cell :list="[currentComment]"></comment-cell>
      <van-cell title="全部评论" />
      <comment-list :article_id="currentComment.com_id" type="c"></comment-list>
    </div>
    <div class="footer">
      <van-button
        plain
        round
        size="small"
        type="info"
        class="comment"
        @click="isPostshow = true"
        >写评论</van-button
      >
    </div>

    <van-popup v-model="isPostshow" position="bottom">
      <comment-postpoup
        :target="currentComment.com_id"
        @closepoup="isPostshow = false"
      ></comment-postpoup>
    </van-popup>
  </div>
</template>

<script>
import CommentCell from "@/components/comment/comment_cell.vue";
import CommentList from "@/components/comment/index.vue";
import CommentPostpoup from "@/components/commentpostpoup";
export default {
  name: "CommentReplay",
  props: ["currentComment"],
  // inject: ["articleId"],
  components: {
    CommentCell,
    CommentList,
    CommentPostpoup,
  },
  data() {
    return {
      isPostshow: false,
    };
  },
};
</script>

<style scoped lang="less">
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 22;
  border-top: 1px solid #d8d8d8;
  text-align: center;
  .comment {
    width: 50%;
    margin: 10px 0;
  }
}

.content {
  padding-top: 92px;
  padding-bottom: 88px;
}
</style>